/*****************************************************************************
 * Copyright (c) 2015, 2017 CEA LIST.
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *  Mickaël ADAM (ALL4TEC) mickael.adam@all4tec.net - Generic shape default value implementation. Default symbol implementation.
 *  Celine JANSSENS (ALL4TEC) celine.janssens@all4tec.net - Bug 471348
 *  Thanh Liem PHAN (ALL4TEC) thanhliem.phan@all4tec.net - Bug 507488
 *  Fanch BONNABESSE (ALL4TEC) fanch.bonnabesse@all4tec.net - Bug 521573, 525463
 *****************************************************************************/

/* Display name in italic when isAbstract=true (bug 464129)*/
[isAbstract=true] {
	italic:true;
}


TimingDiagram * {
	gradient:none;
}
/*---------- Stereotype Display --------- */

StereotypeComment{
	visible:false;
	showTitle:true;
}
 
Compartment[type=StereotypeCompartment]{
	visible:false;
	showTitle:true;
}
 
Compartment[type=StereotypeBrace]{
	visible:false;
}

StereotypeComment Compartment[type=StereotypeBrace]{
	visible:false;
}
 
Label[kind=StereotypeLabel]{
	depth:"none";
}

Port > Label,
InputPin > Label,
OutputPin > Label {
	textAlignment:"left";
}

StereotypePropertyReferenceLink{
	targetDecoration: open_arrow;
	lineStyle: dashed;
	lineDashLength: 5;
	lineDashGap: 5;
}

/*---------- Default SVG symbols ----------*/

/* Round full */
StateMachineDiagram Pseudostate[kind="initial"],
StateMachineDiagram Pseudostate[kind="junction"],
ActivityDiagram InitialNode,
InteractionOverviewDiagram InitialNode
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.infra.gmfdiag.common/icons/symbols/round_full.svg";
}

ActivityDiagram ActivityFinalNode, 
InteractionOverviewDiagram ActivityFinalNode,
StateMachineDiagram FinalState
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.infra.gmfdiag.common/icons/symbols/round_with_dot.svg";
}

ActivityDiagram FlowFinalNode,
InteractionOverviewDiagram FlowFinalNode
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.infra.gmfdiag.common/icons/symbols/round_with_cross.svg";
}

ActivityDiagram SendSignalAction
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.infra.gmfdiag.common/icons/symbols/arrow.svg";
}

ActivityDiagram AcceptEventAction[isTimeEventAction=true]
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.infra.gmfdiag.common/icons/symbols/hourglass.svg";
	maintainSymbolRatio:true;
	displayName:true;
}

ActivityDiagram AcceptEventAction[isTimeEventAction=false]
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.infra.gmfdiag.common/icons/symbols/flag.svg";
	maintainSymbolRatio:false;
	displayName:true;
}


StateMachineDiagram Pseudostate[kind="terminate"]
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.infra.gmfdiag.common/icons/symbols/cross.svg";
}

ActivityDiagram MergeNode,
ActivityDiagram DecisionNode,
InteractionOverviewDiagram MergeNode,
InteractionOverviewDiagram DecisionNode,
StateMachineDiagram Pseudostate[kind="choice"],
ClassDiagram Association
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.infra.gmfdiag.common/icons/symbols/diamond.svg";
}

Actor
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.infra.gmfdiag.common/icons/symbols/stickman.svg";
}

DurationObservation 
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.uml.diagram.common/icons/symbols/durationObservation.svg";
}

TimeObservation 
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.uml.diagram.common/icons/symbols/timeObservation.svg";
}

StateMachineDiagram Pseudostate[kind="shallowHistory"]
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.uml.diagram.common/icons/symbols/shallowHistory.svg";
}

StateMachineDiagram Pseudostate[kind="deepHistory"]
{
	svgFile:"platform:/plugin/org.eclipse.papyrus.uml.diagram.common/icons/symbols/deepHistory.svg";
}

/*---------- Activity Diagram ----------*/

ActivityDiagram MergeNode, 
ActivityDiagram InitialNode, 
ActivityDiagram ActivityFinalNode, 
ActivityDiagram FlowFinalNode, 
ActivityDiagram DecisionNode, 
ActivityDiagram SendSignalAction,
ActivityDiagram AcceptEventAction
{
	displayBorder:false;
	displayName:false;
	diplayIcon:false;
	displayTag:false;
	followSVGSymbol:true;
	maintainSymbolRatio:true;
	transparency:100;
	maxNumberOfSymbol:1;
	useOriginalColors:false;
	gradient:none;
	fillColor:white;
}

ActivityDiagram MergeNode, 
ActivityDiagram DecisionNode{
	maintainSymbolRatio:false;
}

ActivityDiagram InitialNode{
	fillColor: black;
}

/*symbol compartment set to visible */
ActivityDiagram MergeNode > Compartment[kind="symbol"], 
ActivityDiagram InitialNode > Compartment[kind="symbol"], 
ActivityDiagram ActivityFinalNode > Compartment[kind="symbol"], 
ActivityDiagram FlowFinalNode > Compartment[kind="symbol"], 
ActivityDiagram MergeNode > Compartment[kind="symbol"], 
ActivityDiagram SendSignalAction > Compartment[kind="symbol"], 
ActivityDiagram DecisionNode > Compartment[kind="symbol"], 
ActivityDiagram AcceptEventAction > Compartment[kind="symbol"]
{
    visible:true;
}

/*External Label set to visible*/
ActivityDiagram MergeNode > Label, 
ActivityDiagram InitialNode > Label, 
ActivityDiagram ActivityFinalNode > Label, 
ActivityDiagram FlowFinalNode > Label, 
ActivityDiagram DecisionNode > Label,
ActivityDiagram ForkNode > Label,
ActivityDiagram JoinNode > Label
{
	 visible:true;
}

ActivityDiagram SendSignalAction
{
	maintainSymbolRatio:false;
	displayName:true;
}

ActivityDiagram AcceptEventAction[isTimeEventAction=true]{
	displayName: false;
}

ActivityDiagram Activity
{
	leftMarginLabel:10;
	rightMarginLabel:5;
	topMarginLabel:5;
	bottomMarginLabel:5;
}

ActivityDiagram SequenceNode,
ActivityDiagram ConditionalNode,
ActivityDiagram ExpansionRegion,
ActivityDiagram LoopNode,
ActivityDiagram StructuredActivityNode{
	textAlignment:left;
}

ActivityDiagram SequenceNode>Compartment,
ActivityDiagram ConditionalNode>Compartment,
ActivityDiagram ExpansionRegion>Compartment,
ActivityDiagram LoopNode>Compartment,
ActivityDiagram StructuredActivityNode>Compartment{
	lineLength:0;
}

ActivityDiagram ObjectFlow>Label[type=ObjectFlow_WeightLabel],
ActivityDiagram ObjectFlow>Label[type=ObjectFlow_GuardLabel]
{
	visible:false;
}

/* Some actions of the ActivityDiagram should have rounded corner */
ActivityDiagram AcceptCallAction,
ActivityDiagram ClearStructuralFeatureAction,
ActivityDiagram CreateLinkAction,
ActivityDiagram CreateLinkObjectAction,
ActivityDiagram DestroyLinkAction,
ActivityDiagram ReadIsClassifiedObjectAction,
ActivityDiagram ReadExtentAction,
ActivityDiagram ReadLinkAction,
ActivityDiagram ReclassifyObjectAction,
ActivityDiagram ReduceAction,
ActivityDiagram StartClassifierBehaviorAction,
ActivityDiagram StartObjectBehaviorAction,
ActivityDiagram TestIdentityAction,
ActivityDiagram UnmarshallAction {
	radiusWidth:15;
	radiusHeight:15;
}

/* For most Activity diagram nodes (e.g. initial, final, fork, decision, ...), 
 * the element icon is displayed next to the actual object. 
 * By default, we prevent this. 
 * 
 * For standard nodes (OpaqueAction, ...), they are not implemented at all, 
 * so a global selector will not have side effects (yet). 
 */
ActivityDiagram Activity *,InteractionOverviewDiagram Activity * {
	elementIcon:false; 
}

/*---------- Class Diagram ----------*/
ClassDiagram Association
{
	displayBorder:false;
	displayName:false;
	diplayIcon:false;
	displayTag:false;
	followSVGSymbol:true;
	maintainSymbolRatio:true;
	transparency:100;
	displayFloatingLabel:true;
	maxNumberOfSymbol:1;
	useOriginalColors:false;
	gradient:none;
	fillColor:white;
}

ClassDiagram  Association > Compartment[kind="symbol"],
ClassDiagram  DurationObservation > Compartment[kind="symbol"],
ClassDiagram  TimeObservation > Compartment[kind="symbol"]
{
    visible:true;
}

ClassDiagram Dependency
{
	fillColor:Black;
	gradient:none;
}

/*---------- UseCase Diagram ----------*/
UseCaseDiagram UseCase > Compartment {
	lineLengthRatio:"0.70";
}

UseCaseDiagram UseCase {
	topMarginLabel:10;
	isOval: true;
}

UseCaseDiagram UseCase > Compartment[kind="points"] 
{
	visible:false;
}

UseCaseDiagram Actor
{
	displayBorder:false;
	displayName:false;
	diplayIcon:false;
	displayTag:false;
	elementIcon:false;
	followSVGSymbol:true;
	maintainSymbolRatio:true;
	transparency:100;
	/*displayFloatingLabel:true;*/
	maxNumberOfSymbol:1;
	useOriginalColors:false;
	gradient:none;
	fillColor:white;
}

UseCaseDiagram Actor > Compartment[kind="symbol"]
{
    visible:true;
}

UseCaseDiagram Actor > 	Label[type=Actor_NameLabel],
						Label[type=Actor_NameLabel_CN],
						Label[type=Actor_NameLabel_CCN]
{
	visible:true;
	textAlignment:left;
}

/*---------- Communication Diagram ----------*/
CommunicationDiagram  DurationObservation > Compartment[kind="symbol"],
CommunicationDiagram  TimeObservation > Compartment[kind="symbol"]
{
    visible:true;
}

CommunicationDiagram DurationObservation > Label,
CommunicationDiagram TimeObservation > Label
{
	visible:true;
	textAlignment:"left";
}

CommunicationDiagram Interaction
{
	textAlignment: left;
	displayHeader: true;
}

CommunicationDiagram Interaction > Compartment
{
	lineLength:0;
}

/*---------- State Machine Diagram ----------*/
StateMachineDiagram Pseudostate[kind="initial"],
StateMachineDiagram Pseudostate[kind="junction"],
StateMachineDiagram Pseudostate[kind="shallowHistory"],
StateMachineDiagram Pseudostate[kind="terminate"],
StateMachineDiagram Pseudostate[kind="deepHistory"],
StateMachineDiagram Pseudostate[kind="choice"],
StateMachineDiagram FinalState
{
	displayBorder:false;
	displayName:false;
	diplayIcon:false;
	displayTag:false;
	followSVGSymbol:true;
	maintainSymbolRatio:true;
	transparency:100;
	displayFloatingLabel:true;
	maxNumberOfSymbol:1;
	useOriginalColors:false;
	gradient:none;
	fillColor:white;
}

StateMachineDiagram Pseudostate[kind="initial"],
StateMachineDiagram Pseudostate[kind="junction"]
{
	gradient:none;
	fillColor:black;
}

StateMachineDiagram Pseudostate[kind="exitPoint"],
StateMachineDiagram Pseudostate[kind="entryPoint"]
{
	isOval: true;
}

StateMachineDiagram Pseudostate[kind="initial"] > Label,
StateMachineDiagram Pseudostate[kind="junction"] > Label,
StateMachineDiagram Pseudostate[kind="shallowHistory"] > Label,
StateMachineDiagram Pseudostate[kind="terminate"] > Label,
StateMachineDiagram Pseudostate[kind="deepHistory"] > Label,
StateMachineDiagram Pseudostate[kind="choice"] > Label,
StateMachineDiagram FinalState> Label,
StateMachineDiagram Pseudostate[kind="exitPoint"] > Label,
StateMachineDiagram Pseudostate[kind="entryPoint"] > Label,
StateMachineDiagram Pseudostate[kind="join"] > Label,
StateMachineDiagram Pseudostate[kind="fork"] > Label
{
	visible:true;
	textAlignment:"Left";
}

StateMachineDiagram Pseudostate[kind="initial"] > Compartment[kind="symbol"],
StateMachineDiagram Pseudostate[kind="shallowHistory"] > Compartment[kind="symbol"],
StateMachineDiagram Pseudostate[kind="terminate"] > Compartment[kind="symbol"],
StateMachineDiagram Pseudostate[kind="deepHistory"] > Compartment[kind="symbol"],
StateMachineDiagram Pseudostate[kind="choice"] > Compartment[kind="symbol"],
StateMachineDiagram Pseudostate[kind="junction"] > Compartment[kind="symbol"],
StateMachineDiagram FinalState > Compartment[kind="symbol"]
{
    visible:true;
}

StateMachineDiagram Pseudostate[kind="choice"]{
	maintainSymbolRatio:false;
}

StateMachineDiagram State{
	canonical:true;
}

/*---------- Composite Diagram ---------*/

CompositeStructureDiagram Property[aggregation="shared"]{
	borderStyle: custom;
}

CompositeStructureDiagram DurationObservation > Compartment[kind="symbol"],
CompositeStructureDiagram TimeObservation > Compartment[kind="symbol"]{
    visible:true;
}

CompositeStructureDiagram DurationObservation > Label,
CompositeStructureDiagram TimeObservation > Label,
CompositeStructureDiagram Port > Label,
CompositeStructureDiagram Parameter > Label{
    visible:true;
    textAlignment:"left";
}

/*Fix of Bug 481701: this permits to hide floating label of collaboration roles which don't have a specific Semantic Element*/
CompositeStructureDiagram Collaboration > Compartment[kind=internalstructure] > * > Label[kind=FloatingLabel]{
	visible:false;
}

CompositeStructureDiagram Port{
	isPortResizable:true;
}

/*---------- Component Diagram ----------*/

ComponentDiagram Port > Label{
    visible:true;
    textAlignment:"left";
}

/*---------- Interaction Overview Diagram ----------*/

InteractionOverviewDiagram MergeNode, 
InteractionOverviewDiagram InitialNode, 
InteractionOverviewDiagram ActivityFinalNode, 
InteractionOverviewDiagram FlowFinalNode, 
InteractionOverviewDiagram DecisionNode
{
	displayBorder:false;
	displayName:false;
	diplayIcon:false;
	displayTag:false;
	followSVGSymbol:true;
	maintainSymbolRatio:true;
	transparency:100;
	maxNumberOfSymbol:1;
	useOriginalColors:false;
	gradient:none;
	fillColor:white;
}

InteractionOverviewDiagram MergeNode, 
InteractionOverviewDiagram DecisionNode{
	maintainSymbolRatio:false;
}

InteractionOverviewDiagram InitialNode{
	fillColor:black;
}

/*symbol compartment set to visible */
InteractionOverviewDiagram MergeNode > Compartment[kind="symbol"], 
InteractionOverviewDiagram InitialNode > Compartment[kind="symbol"], 
InteractionOverviewDiagram ActivityFinalNode > Compartment[kind="symbol"], 
InteractionOverviewDiagram FlowFinalNode > Compartment[kind="symbol"], 
InteractionOverviewDiagram MergeNode > Compartment[kind="symbol"], 
InteractionOverviewDiagram DecisionNode > Compartment[kind="symbol"], 
InteractionOverviewDiagram SendSignalAction > Compartment[kind="symbol"]
{
    visible:true;
}

/*External Label set to visible*/
InteractionOverviewDiagram MergeNode > Label, 
InteractionOverviewDiagram InitialNode > Label, 
InteractionOverviewDiagram ActivityFinalNode > Label, 
InteractionOverviewDiagram FlowFinalNode > Label, 
InteractionOverviewDiagram DecisionNode > Label, 
InteractionOverviewDiagram ForkNode > Label,
InteractionOverviewDiagram JoinNode > Label
{
	 visible:true;
}

InteractionOverviewDiagram Activity
{
	leftMarginLabel:10;
	rightMarginLabel:5;
	topMarginLabel:5;
	bottomMarginLabel:5;
}

/*---------- Sequence Diagram ----------*/

SequenceDiagram InteractionOperand {
	borderStyle: dash;
}

SequenceDiagram Interaction {
	textAlignment:"left";
	displayHeader:true;
}

SequenceDiagram InteractionUse {
	textAlignment:"center";
	leftMarginLabel: 5;
	topMarginLabel: 5;
	rightMarginLabel: 5;
	bottomMarginLabel: 5;
	displayHeader:true;
}

SequenceDiagram Interaction > Compartment{
	displayBorder:false;
}

SequenceDiagram Lifeline {
	displayBorder:false;
}

SequenceDiagram CombinedFragment {
	textAlignment:"left";
	displayHeader:true;
}

SequenceDiagram CombinedFragment > Compartment{
	displayBorder:false;
}

SequenceDiagram ConsiderIgnoreFragment {
	textAlignment:"left";
	displayHeader:true;
}

SequenceDiagram ConsiderIgnoreFragment > Compartment {
	displayBorder:false;
}

SequenceDiagram Message[messageSort="createMessage"] {
	targetDecoration: open_arrow;
	lineStyle: dash;
}

SequenceDiagram Message[messageSort="asynchCall"] {
	targetDecoration: open_arrow;
}

/*Message Found */
SequenceDiagram Message[messageSort="asynchCall"][sendEvent=""] {
	targetDecoration: open_arrow;
}

/* Message Lost */
SequenceDiagram Message[messageSort="asynchCall"][receiveEvent=""] {
	targetDecoration: open_arrow;
}

SequenceDiagram Message[messageSort="synchCall"] {
	targetDecoration: solid_arrow_filled;
}

SequenceDiagram Message[messageSort="reply"] {
	targetDecoration: open_arrow;
	lineStyle: dash;
}

SequenceDiagram Message[messageSort="deleteMessage"] {
	targetDecoration: solid_arrow_filled;
}

